Prizm Document Converter
Convert Content with CCS

Performing Content Conversion

Step 1: Upload Your Source Document

Example:
Copy Code
POST http://192.168.0.1:18681/PCCIS/V1/WorkFile?FileExtension=doc
Content-Type: application/octet-stream
[binary data]

200 OK
Content-Type: application/json
{
    "fileId": "5qTYa3gzN9gYUb5SzqUhqg",
}

Step 2: Start the Content Conversion Process

See the "Conversion Input Examples" section below for example JSON strings that can be used as input in to create various ContentCoverter processes.

Example:
Copy Code
POST http://192.168.0.1:18681/PCCIS/V1/ContentConverter
Content-Type: application/json
{
    "input": {
        "src": {
            "fileId": "mUiXiqsQuevJKO9Swa32Bd"
        },
        "dest": {
            "format": "pdf",
            "pdfOptions": {
                "forceOneFilePerPage": true
            }
        }
    }
}

200 OK
Content-Type: application/json
{
    "processId": "bQpcuixhvGmNqn5ElskO6Q",
    "expirationDateTime": "2014-12-03T18:30:49.460Z",
    "input": {
        "src": {
            "fileId": "mUiXiqsQuevJKO9Swa32Bd"
        },
        "dest": {
            "format": "pdf",
            "pdfOptions": {
                "forceOneFilePerPage": true
            }
        }
    },
    "state": "processing",
    "percentComplete": 0
}

Step 3: Check Status of the ContentConverter Resource

Example:
Copy Code
GET http://192.168.0.1:18681/PCCIS/V1/ContentConverter/bQpcuixhvGmNqn5ElskO6Q

200 OK
Content-Type: application/json
{
    "processId": " bQpcuixhvGmNqn5ElskO6Q ",
    "expirationDateTime": "2014-12-03T18:30:49.460Z",
    "input": {
        "src": {
            "fileId": "mUiXiqsQuevJKO9Swa32Bd"
        },
        "dest": {
            "format": "pdf",
            "pdfOptions": {
                "forceOneFilePerPage": true
            }
        }
    },
    "state": "complete",
    "percentComplete": 100,
    "output": {
        "results": [
            {
                "fileId": "ek5Zb123oYHSUEVx1bUrVQ",
                "src": [
                    {
                        "fileId": "mUiXiqsQuevJKO9Swa32Bd",
                        "pages": "1"
                    }
                ]
            }
            {
                "fileId": "KOrSwaqsguevJ97BdmUbXi",
                "src": [
                    {
                        "fileId": "mUiXiqsQuevJKO9Swa32Bd",
                        "pages": "2"
                    }
                ]
            }
            {
                "fileId": "o349chskqw93kwaqsgfevJ",
                "src": [
                    {
                        "fileId": "mUiXiqsQuevJKO9Swa32Bd",
                        "pages": "3"
                    }
                ]
            }
        ]
    }
}

Step 4: Download the Converted Document(s)

Example:
Copy Code
GET http://192.168.0.1:18681/PCCIS/V1/WorkFile/ek5Zb123oYHSUEVx1bUrVQ

200 OK
Content-Type: application/pdf
[binary data]

Conversion Input Examples

Below are example JSON strings that can be used as input in Step 2 above to create various ContentCoverter processes.

Multi-Page Word Document to Multi-Page PDF Document

This example will convert all pages of a Word document to a single PDF document.

Example:
Copy Code
"input": {
        "src": {
            "fileId": "mUiXiqsQuevJKO9Swa32Bd"
        },
        "dest": {
            "format": "pdf",
            "pdfOptions": {
                "forceOneFilePerPage": false
            }
        }
}

Single-Page Word Document to Scaled PNG Image

This example will convert a single page Word Document to a PNG image, scaled to 800 pixels width. Height will adjust automatically to maintain aspect ratio.

Example:
Copy Code
"input": {
        "src": {
            "fileId": "mUiXiqsQuevJKO9Swa32Bd"
        },
        "dest": {
            "format": "png",
            "pngOptions": {
                "maxWidth": "800px"
            }
        }
}

Multi-Page Word Document to Multiple PNG Images

This example will convert a multi-page Word Document to multiple, single page PNG images. As PNG is not a multi-page format, each page of the Word Document will be converted to a separate PNG.

Example:
Copy Code
"input": {
        "src": {
            "fileId": "mUiXiqsQuevJKO9Swa32Bd"
        },
        "dest": {
            "format": "pdf"
        }
}

JPEG Image to PNG Image

This example will convert a JPEG image to a PNG image, scaled to fit within 800 pixels width and 600 pixels height. The output PNG will be as large as it can be while maintaining aspect ratio and remaining within these bounds.

Example:
Copy Code
"input": {
        "src": {
            "fileId": "mUiXiqsQuevJKO9Swa32Bd"
        },
        "dest": {
            "format": "pdf",
            "pngOptions": {
                "maxWidth": "800px",
                "maxHeight": "600px"
            }
        }
}

 

 


©2015. Accusoft Corporation. All Rights Reserved.

Send Feedback